package com.example.hospital.mis.controller;

import com.example.hospital.common.R;
import com.example.hospital.db.mapper.MisUserMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;

@RequestMapping("/test")
@RestController
public class Test {
  @Value("${result.key}")
  private String res;
  
  @Resource
  private MisUserMapper misUserMapper;
  
  @GetMapping("/permissions/{id}")
    public R getPermissions(@PathVariable("id") Integer userId) {
      ArrayList <String> list = misUserMapper.searchUserPermissions(userId);
      return R.ok().put(res, list);
    }
}
